<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>救助信息录入</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="plugins/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="css/font_eolqem241z66flxr.css" media="all" />

</head>
<body class="childrenBody">
<blockquote class="layui-elem-quote" style="border-left: 5px solid #ffffff">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>救助信息录入</legend>
    </fieldset>
</blockquote>
<form class="layui-form">

    <div class="layui-form-item">
        <label class="layui-form-label">事故编号</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input accidentId" name="accidentId" id="accidentId" lay-verify="required" placeholder="请输入事故编号">
        </div>

        <label class="layui-form-label">事故名称</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input accidentName"  name="accidentName" id="accidentName" lay-verify="required" placeholder="请输入事故名称">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">救助及时？</label>
        <div class="layui-input-inline">
            <input type="radio" name="timely" value="是" title="及时" checked="">
            <input type="radio" name="timely" value="否" title="不及时">
        </div>

        <label class="layui-form-label">救助成功？</label>
        <div class="layui-input-inline">
            <input type="radio" name="successly" value="是" title="成功" checked>
            <input type="radio" name="successly" value="否" title="不成功">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">救助机构</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input helpService"  name="helpService" id="helpService" lay-verify="required" placeholder="请输入救助机构名">
        </div>

        <label class="layui-form-label">救助船只</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input helpBoat"  name="helpBoat" id="helpBoat"   placeholder="请输入实施救助船只名称">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">挽回损失</label>
        <div class="layui-input-block">
            <textarea placeholder="请输入挽回的损失，如经济、环境方面"  name="loss" id="loss"  class="layui-textarea loss"></textarea>
        </div>

    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="addHelp">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
<script src="js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="plugins/layui/layui.js"></script>
<script>
    layui.use(['form','laydate'], function () {
        var form=layui.form(),
                laydate=layui.laydate();
      //监听提交
        form.on('submit(addHelp)', function(data) {
        	debugger;
            var index = top.layer.msg('数据提交中，请稍候',{icon: 16,time:false,shade:0.8});
            $.ajax({
            	contentType:'application/x-www-form-urlencoded; charset=UTF-8',
            	url : "help/addHelp",
            	type : "post",
            	data : data.field,
            	dataType : "json"
            })
            //弹出loading
            var index = top.layer.msg('数据提交中，请稍候',{icon: 16,time:false,shade:0.8});
            setTimeout(function(){
                top.layer.close(index);
                top.layer.msg("信息添加成功！");
                layer.closeAll("iframe");
                //刷新父页面
                parent.location.reload();
            },12000);
            return false;
        })

    });
</script>
</body>
</html>